package com.insyte.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by Khai on 7/2/2015.
 */
public class Category implements Parcelable {
    private String id;
    private String name;
    private String category;
    private String created_time;
    private ArrayList<CategoryList> categoryLists = new ArrayList<CategoryList>();

    public Category() {

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCreated_time() {
        return created_time;
    }

    public void setCreated_time(String created_time) {
        this.created_time = created_time;
    }

    public ArrayList<CategoryList> getCategoryLists() {
        return categoryLists;
    }

    public void setCategoryLists(ArrayList<CategoryList> categoryLists) {
        this.categoryLists = categoryLists;
    }

    // For parcelable

    public Category(Parcel parcel) {
        id = parcel.readString();
        name = parcel.readString();
        category = parcel.readString();
        created_time = parcel.readString();
        parcel.readTypedList(categoryLists, null);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(id);
        parcel.writeString(name);
        parcel.writeString(category);
        parcel.writeString(created_time);
        parcel.writeTypedList(categoryLists);
    }

    public static final Creator<Category> CREATOR = new Creator<Category>() {
        @Override
        public Category createFromParcel(Parcel parcel) {
            return new Category(parcel);
        }

        @Override
        public Category[] newArray(int i) {
            return new Category[i];
        }
    };
}
